﻿<!-- Copyright (c) Microsoft Corporation.  All rights reserved. -->
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0"
      xmlns:vsfxim="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.Immutable.11.0"
      xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.11.0"
      xmlns:image="clr-namespace:PhotoStartPageControl;assembly=PhotoStartPageControl"
      mc:Ignorable="d" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="600" d:DesignWidth="800">

    <Grid.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Microsoft.VisualStudio.Shell.11.0;component/UI/Styles/startpageresources.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <SolidColorBrush x:Key="Backing" Opacity="0.05" Color="White"></SolidColorBrush>
        </ResourceDictionary>
    </Grid.Resources>

    <Border Background="{DynamicResource Backing}">
        <Grid x:Name="LayoutRoot" VerticalAlignment="Bottom" Margin="0" >

            <Grid.ColumnDefinitions>
                <!-- Left Hand Column -->
                <!-- This column is just wide enough to fit the Command Buttons and Start Page Options.
                    The Recent Project area is constrained to the width of the Commmand Buttons. -->
                <ColumnDefinition MinWidth="{Binding ElementName=commandButtonsGrid, Path=ActualWidth}" Width="3*" MaxWidth="330" />

                <!-- Gutter -->
                <ColumnDefinition Width="6"/>

                <!-- Center Column -->
                <ColumnDefinition Width="4*" />

                <!-- Gutter -->
                <ColumnDefinition Width="6"/>

                <!-- Right Columns Allow main column to collapse to 0 -->
                <ColumnDefinition Width="Auto" MinWidth="0"/>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <StackPanel Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="0" Height="Auto" Margin="0,0,0,15">
                <Image Source="{Binding ElementName=backgroundImageControl, Path=StartPageImage}" Stretch="Uniform" />
            </StackPanel>

            <!--Left Column-->
            <Grid Grid.Column="0" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="15,0,0,15">
                <Grid.RowDefinitions>
                    <!-- Command Buttons for New Projects -->
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <!-- Command Buttons -->
                <Grid x:Name="commandButtonsGrid" Margin="0" HorizontalAlignment="Left">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <vs:ImageButton 
                    x:Uid="ConnectToTSButton"
                    Margin="0,2,15,2"
                    Width="Auto" 
                    Content="Connect To Team Foundation Server"
                    Visibility="{Binding Path=TeamFoundationClientSupported, Converter={StaticResource boolToVisibilityConverter}}"	
                    Style="{DynamicResource StartPage.ProjectCommand.ButtonStyle}"
                    Command="{x:Static vsfxim:VSCommands.ExecuteCommand}" CommandParameter="Team.ConnecttoTeamFoundationServer"
                    ImageNormal="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/ConnectToTFS.png"
                    ImageHover="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/ConnectToTFSMouseOver.png"
                    ImagePressed="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/ConnectToTFSMouseDown.png">
                    </vs:ImageButton>

                    <vs:ImageButton
                    Grid.Row="2"
                    x:Uid="NewProjectButton"
                    Margin="0,2"
                    Width="Auto" 
                    Content="New Project..."
                    Style="{DynamicResource StartPage.ProjectCommand.ButtonStyle}"
                    Command="{x:Static vsfxim:VSCommands.ExecuteCommand}" CommandParameter="File.NewProject"
                    ImageNormal="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/NewProject.png"
                    ImageHover="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/NewProjectMouseOver.png"
                    ImagePressed="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/NewProjectMouseDown.png">
                    </vs:ImageButton>

                    <vs:ImageButton
                    Grid.Row="4"
                    x:Uid="OpenProjectButton"
                    Margin="0,2"
                    Width="Auto"        
                    Content="Open Project..."
                    Style="{DynamicResource StartPage.ProjectCommand.ButtonStyle}"
                    Command="{x:Static vsfxim:VSCommands.ExecuteCommand}" CommandParameter="File.OpenProject"
                    ImageNormal="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/OpenProject.png"
                    ImageHover="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/OpenProjectMouseOver.png"
                    ImagePressed="pack://application:,,,/Microsoft.VisualStudio.Shell.11.0;component/UI/Images/OpenProjectMouseDown.png">
                    </vs:ImageButton>

                </Grid>

            </Grid>

            <!-- Center Column -->
            <Grid Grid.Column="2" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,0,0,15" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <!-- Recent Projects Section -->
                <Grid Grid.Row="0" HorizontalAlignment="Left" Width="Auto">
                    <Grid.RowDefinitions>
                        <!-- Heading -->
                        <RowDefinition Height="Auto" />
                        <!-- MRU Container -->
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>

                    <!-- Recent Projects Heading-->
                    <StackPanel Grid.Row="0" Margin="0,0,0,10" Orientation="Horizontal">
                        <TextBlock Text="Recent Projects" VerticalAlignment="Top" Style="{DynamicResource StartPage.HeadingTextStyle}" x:Uid="RecentProjects" Margin="0"/>
                        <Path VerticalAlignment="Center" Margin="6,0,0,-4" Width="Auto" Height="1" Stretch="Fill" StrokeThickness="1" StrokeLineJoin="Round" Stroke="{DynamicResource {x:Static vs:EnvironmentColors.StartPageSeparatorBrushKey}}" Data="F1 M 0.5,0.5L 199.5,0.5"/>
                    </StackPanel>
                    <!-- MRU List Container -->
                    <ScrollViewer Grid.Row="1" HorizontalAlignment="Stretch" Style="{DynamicResource StartPage.ScrollViewerStyle}" VerticalAlignment="Stretch"  VerticalScrollBarVisibility="Auto">
                        <vs:MruListBox 
                        DataContext="{Binding RecentProjects}" 
                        ItemsSource="{Binding Path=Items}"
                        Background="Transparent"
                        BorderThickness="0"
                        AutomationProperties.AutomationId="MruList"/>
                    </ScrollViewer>
                </Grid>

            </Grid>

            <!-- Right Column -->
            <!-- Start Page Options -->
            <StackPanel Grid.Column="4" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,15,15">
                <CheckBox x:Uid="AutoClose_Option" Content="Close page after project load" IsChecked="{Binding ClosePageOnOpenProject, Mode=TwoWay}" Margin="0,0,2,0"/>
                <CheckBox x:Uid="ShowOnStartUp_Option" Content="Show page on startup" IsChecked="{Binding ShowPageAtStartup, Mode=TwoWay}" Margin="0,2,0,0"/>
                <image:BackgroundImageControl x:Name="backgroundImageControl" />
            </StackPanel>

        </Grid>
    </Border>
</Grid>
